package com.ocom.mjrecode.controller;


import com.ocom.common.constant.MjRecodeUrl;
import com.ocom.common.resp.Result;
import com.ocom.common.utils.ResultUtil;
import com.ocom.mjrecode.service.MjRecodeService;
import com.ocom.mjrecode.vo.YmDataGroupByMachVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MachController {

	@Autowired
	MjRecodeService mjRecodeService;

	@PostMapping(MjRecodeUrl.URL_getRecodeNum)
	public Result getRecodeNum(Long companyId){
		return ResultUtil.success(mjRecodeService.getRecodeNum(companyId));
	}

	// 依据设备获取统计列表 （getYmDataGroupByMach）
	@PostMapping(MjRecodeUrl.URL_getYmDataGroupByMach)
	public Result getYmDataGroupByMach(@Validated @RequestBody YmDataGroupByMachVo ymDataGroupByMachVo){

		return mjRecodeService.getYmDataGroupByMach(ymDataGroupByMachVo);
	}


}
